/*************************************************************************
	> File Name: oj-221_grab_balloon.cpp
	> Author: Wang Bo
	> Mail: 1276106221@qq.com
	> Created Time: 2020年11月06日 星期五 22时15分34秒
 ************************************************************************/

#include <iostream>
#include <algorithm>
#include <vector>
#include <cstdio>
using namespace std;

typedef pair<int, int> duo;
duo kids[100005];
vector<int> balloons;

bool comp_height(const duo &a, const duo &b) {
    return a.second < b.second;
}

bool comp_id(const duo &a, const duo &b) {
    return a.first < b.first;
}

int main() {
    int n, m;
    scanf("%d%d", &n, &m);
    for (int i = 0; i < n; ++i) {
        scanf("%d", &kids[i].second);
        kids[i].first = i + 1;
    }
    for (int i = 0; i < m; ++i) {
        int bln;
        scanf("%d", &bln);
        balloons.push_back(bln);
    }
    sort(kids, kids + n, comp_height);
    sort(balloons.begin(), balloons.end());
    for (int i = 0; i < n; ++i) {
        int cnt = 0;
        for (auto it = balloons.begin(); it != balloons.end();) {
            if ((*it) <= kids[i].second) {
                cnt++;
                auto t = it;
                balloons.erase(t);
            }
            else {
                break;
            }
        }
        kids[i].second = cnt;
    }
    sort(kids, kids + n, comp_id);
    for (int i = 0; i < n; ++i) {
        printf("%d\n", kids[i].second);
    }
    return 0;
}
